package components;

import java.awt.Color;

import com.uqbar.vainilla.DeltaState;
import com.uqbar.vainilla.GameComponent;
import com.uqbar.vainilla.appearances.Appearance;
import com.uqbar.vainilla.appearances.Circle;
import com.uqbar.vainilla.events.constants.MouseButton;

public class Cursor extends GameComponent {

	public Cursor(){
		this(new Circle(Color.MAGENTA, 10));
	
	}
	public Cursor(Appearance ap){
		this.setZ(20);
		this.setAppearance(ap);
	
	}
	
	public void update(DeltaState delta){
		super.update(delta);
		this.setX(delta.getCurrentMousePosition().x);
		this.setY(delta.getCurrentMousePosition().y);

		
		if (delta.isMouseButtonReleased(MouseButton.LEFT)){
			this.onLeftClick(delta.getCurrentMousePosition().x, delta.getCurrentMousePosition().y);
		}
	}

	public void onLeftClick(double x, double y) {
		
	}
}
